package day3;

import java.util.Scanner;

public class Zhishu {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.print("请输入一个数字:");
        int num = in.nextInt();
        boolean zhishu = true;
        for (int i = 2, k = (int) (Math.sqrt(num) + 1); i <= k; i++) {
            if (num % i == 0) {
                System.out.println("这个数不是质数");
                zhishu = false;
                break;
            }
        }
        if (zhishu) {
            System.out.println("这个数是质数");
        }

    }
}
